﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<brjostagjof.Models.SpecialistUser>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	Fagaðilar
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
         <a href="/Home/Index/" class="linksWhite">Til baka á forsíðu</a>
    <% if (Page.User.IsInRole("Administrators"))
       { %>
        <p> <a href="/Account/RegisterSpecialist" style=" color:Red;"> Skrá nýjann fagaðila</a>
        <a href="/Home/AddSpecialistCategory/" style=" color:Red;"> Gera nýjan flokk fagaðila </a></p>
     <%} %>
        <h2>Flokkar fagaðila:</h2>
    <ul>
        <% var categories = brjostagjof.Controllers.HomeController.GetSpecialistCategories();
        foreach (var category in categories)
        { %>
            <li>
            <a href="/Home/GetSpecialistByCategoryID/<%: category.ID %>"><%: category.name%></a>
            </li>
        <% } %>
    </ul>

    <h2>Listi yfir alla fagaðila:</h2>
    <ul>
        <%foreach(var item in Model) 
          { %>
        <li>
              <a href="/MySite/ViewUserByID/<%:item.userID %>"> <%:  item.User.name %></a>
              <%: item.SpecialistCategory.name %>
        </li>
        <%} %>
        
    </ul>
</asp:Content>
